Computer graphics applications can be used to render a three-dimensional model. For instance, an interactive geographic information system can be used to present an interactive three-dimensional model of a geographic area to a user in a suitable user interface, such as a browser. A user can navigate the three-dimensional model by controlling a virtual camera that specifies what portion of the three-dimensional model is rendered and presented to a user. The three-dimensional model can include a polygon mesh, such as a triangle mesh, used to model the geometry (e.g. terrain, buildings, and other objects) of the geographic area. Geographic imagery, such as aerial or satellite imagery, can be texture mapped to the polygon mesh so that the three-dimensional model provides a more accurate and realistic representation of the scene.
Shading operations can be performed on the three-dimensional model to adjust the appearance of the three-dimensional model, such as to add surface lighting for sunlight, shadows, and atmospheric effects. A shading operation applies light or color within a computer graphics pipeline to change the appearance of the graphical representation of the three-dimensional model. Shading operations are typically performed using normal information determined for the polygon mesh. The normals determine how much light or color is applied to each point on a surface of the polygon mesh.
Determining good normals for generating realistic shading effects can be difficult because the polygon mesh only provides an approximation of the true surface modeled by the polygon mesh. For example, using vertex normals for shading operations can result in smoothing of sharp features in the three-dimensional model (e.g. building edges) represented in the polygon mesh. Using face normals for shading operations can result in the three-dimensional model looking triangulated or faceted with discontinuities between the polygon faces, which can disrupt the appearance of smooth features (e.g. smooth terrain) in the three-dimensional model.